<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="model.Veiculo" %>
<%@ page import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Insert title here</title>
	</head>
	<body>
		<%
			ArrayList<Veiculo> veiculos = (ArrayList<Veiculo>) session.getAttribute("veiculos");
			if(veiculos!=null){
		%>
		<table border="1">
		  <tr>
		    <th>Marca</th>
		    <th>Cor</th>
		    <th>Placa</th>
		    <th>Chassi</th>
		    <th>Ano</th>
		  </tr>
		  
		  <% for(Veiculo veiculo : veiculos){%>
		  <tr>
		    <td><%= veiculo.getMarca() %></td>
		    <td><%= veiculo.getCor() %></td>
		    <td><%= veiculo.getPlaca() %></td>
		    <td><%= veiculo.getChassi() %></td>
		    <td><%= veiculo.getAno() %></td>
		  </tr>
		  <%}%>	
		  		
		  <c:forEach var="veiculo" items="${veiculos}">
		  <tr>
			<td>${veiculo.marca}</td>
		    <td>${veiculo.cor}</td>
		    <td>${veiculo.placa}</td>
		    <td>${veiculo.chassi}</td>
		    <td>${veiculo.ano}</td>
		  </tr>
		  </c:forEach>
		</table>
		<%}%>
	</body>
</html>